<?php
function smarty_function_vfriend_userinfo($params, &$smarty)
{
	$intUserId 			= isset($params['id']) ? $params['id'] : 0;	
	$intTargetId		= isset($params['view']) ? $params['view'] : 0;	
	$objVfriendUser		= new Vfriend_User();
	$objCover			= new Cover();
	$objUser			= $objVfriendUser->getFull($intUserId);	
	$intCheckLike		= $objVfriendUser->checkLike($intUserId, $intTargetId);
	$intRelationType	= $objVfriendUser->getRelationType($intTargetId,$intUserId);	
	$strToken			= $objUser->hex . '_' . $intTargetId;
	$objUcover			= $objCover->getCoverByUserId($intUserId);
	if($objUser->fullhouseid > 0) {
		$intPartnerId	= $objVfriendUser->getPartner($intUserId,$intPartnerType);
		$smarty->assign('intPartnerId', $intPartnerId);
		$smarty->assign('intPartnerType', $intPartnerType);
	}
	$smarty->assign('checkLike', 			$intCheckLike);
	$smarty->assign('relationType',			$intRelationType);
	$smarty->assign('strToken', 			$strToken);
	$smarty->assign('objUserForPlugins', 	$objUser);
	$smarty->assign('objUcover',			$objUcover);
	$smarty->display(ROOT_DIR . '/library/Vfriend/Plugins/Tpl/box-userinfo.tpl');
}
?>